﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Alex.Library.Specifications
{
    /// <summary>
    /// Composited Specification
    /// </summary>
    /// <typeparam name="T">any type</typeparam>
    public abstract class CompositeSpecification<T> : Specification<T>, ICompositeSpecification<T>        
    {
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="front">the first specification.</param>
        /// <param name="behind">the second specification.</param>
        public CompositeSpecification(ISpecification<T> front, ISpecification<T> behind)
        {
            this._Front = front;
            this._Behind = behind;
        }

        private readonly ISpecification<T> _Front;
        /// <summary>
        /// get the first specification
        /// </summary>
        public ISpecification<T> Front
        {
            get { return this._Front; }
        }

        private readonly ISpecification<T> _Behind;
        /// <summary>
        /// get the second specification
        /// </summary>
        public ISpecification<T> Behind
        {
            get { return this._Behind; }
        }
    }
}
